package com.hizt.consumer.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConfigBean {


    @Bean
    public IRule rule() {

        //随机
        //IRule rule = new RandomRule();

        //权重进行获取
        IRule rule = new WeightedResponseTimeRule();
        return rule;
    }

}
